<template>
  <div class="skills_detail">
    <h2>{{ info.title }}</h2>
    <div class="content" v-html="info.content"></div>
  </div>
</template>

<script>
import { auxiliaryQuery } from '@/api/plantList'
export default {
  data() {
    return {
      info: {
        title: '',
        content: ''
      }
    }
  },
  mounted() {
    this.getList()
  },
  methods: {
    async getList() {
      const id = this.$route.params.id.split('&')[1]
      const params = {
        id,
        page_num: this.currentPage,
        page_size: 10,
        conditions: [{
          key: 'type_info',
          operator: 'eq',
          value: this.$route.params.id.split('&')[0]
        }],
        order_info: {
          key: 'create_time',
          order: 'desc'
        }
      }
      const res = await auxiliaryQuery(params)
      const code = Number(res.code)
      if (code === 200) {
        this.total = res.paging.total
        this.info.title = res.data && res.data.filter(({id})=>id == this.$route.params.id.split('&')[1])[0].title
        this.info.content = res.data && res.data.filter(({id})=>id == this.$route.params.id.split('&')[1])[0].text_info
      }
    }
  }
}
</script>

<style lang="scss">
.skills_detail{
  .content{
    text-indent: 20px;
  }
}
</style>
